Field of the Invention
The invention relates to an image processing apparatus, an image capturing apparatus, an image processing method, and a non-transitory computer-readable storage medium.
Description of the Related Art
A recent image capturing apparatus such as a digital camera or a digital camcorder employs a CCD sensor or a CMOS sensor as an image sensor. These sensors are mainly formed from a single CCD or CMOS sensor. A color filter array (to be referred to as a CFA hereinafter) on the sensor surface acquires the pixel value of one color component (for example, one of R, G, and B components) in one pixel. When the CFA is used, for example, image data (to be referred to as RAW data hereinafter) of a Bayer arrangement having a periodical pattern of R (red), G0 (green), B (blue), and G1 (green) as shown in FIG. 2A can be obtained. A human vision has high sensitivity to a luminance component. Hence, in RAW data shown in FIG. 2A, a green component including a large amount of luminance component is assigned pixels in a number twice larger than a red component or a blue component. Since the RAW data has only the information of one color component in one pixel, as described above, the pixel values of red, blue, and green components need to be generated for one pixel using de-mosaicing. De-mosaicing is processing of collecting short color information from the peripheral pixels of each pixel and giving the information to the pixel, thereby compensating for color information and creating a full-color image.
In general, an image capturing apparatus encodes and records image data of RGB signals obtained by de-mosaicing or image data of YUV signals obtained by converting RGB signals. On the other hand, a method of encoding and recording RAW data before de-mosaicing is also recently proposed.
For example, Japanese Patent Laid-Open No. 2003-125209 discloses a method of separating RAW data into signal components (R, G0, B, and G1) to put the four components (planes) in order and then encoding the data.
However, when RAW data is separated into the color signal components, the G0 component and the G1 component, which are originally located at close pixel positions and have a high correlation because of the same color, are separated into different planes. Hence, the pixel values of adjacent pixels may be discrete in each of G0 and G1, and the encoding efficiency may consequently be lowered.